<?php
include_once '../inc/config.inc.php';
include_once '../inc/mysqli.inc.php';
include_once '../inc/tool.inc.php';
$link=connect();
if(!$memberid=is_login($link)){
    $url=urlencode("$_SERVER[REQUEST_URI]");
    skip("login.php?url={$url}",'error','请登陆之后再进行相关操作！');
}
$querym="select *from member where id={$memberid}";
$resultm=execute($link,$querym);
$datam=mysqli_fetch_assoc($resultm);
$query="select *from content where memberid={$memberid}";
$count_all=mysqli_num_rows(execute($link,$query));

$page_cur=3; $datas=pages($count_all,$page_cur);




$template='会员中心';
include_once 'inc/header.inc.php';
?>
<div class="lftop">
            <div class="wrap">
                <h2 class="top_dir"><a href="index.php">首页</a>&nbsp;&gt;&nbsp;<?php echo "{$datam['name']} (发帖数：{$count_all})" ?></h2>
            </div>
        </div>


        <div class="lfmain">
            <div class="wrap clear-float">
                <div class="lfleft fl">
                    <div class="content">                      
                        <div class="middle_part">
                            <div class="comment">
                            <?php                           
                            if(!$count_all){
                                echo '<div class="group clear-float">暂无发表内容...</div>';
                            }else{
                                $query="select *from content where memberid={$memberid} limit {$datas['limit']}";
                                $resultt=execute($link,$query);
                                while($datat=mysqli_fetch_assoc($resultt)){
                                    $datat=dehtml($datat);
                                    $datat['title']=tonl2br($datat['title']);
                                    $queryc="select *from childModule where id={$datat['cmid']}";
                                    $datac=mysqli_fetch_assoc(execute($link,$queryc));
                                    $datac=dehtml($datac);
                                    $queryr="select *from reply where contentid={$datat['id']} order by id desc";
                                    $resultr=execute($link,$queryr);
                                    $count_rp=mysqli_num_rows($resultr);

                                    $url=urlencode("mb_delete.php?id={$datat['id']}");
                                    $rturl=urlencode("$_SERVER[REQUEST_URI]");
                                    $message=urlencode("确认要删除帖子 <span style='color:rgb(218, 126, 114);'>{$datat['title']}</span> 的内容么？&nbsp;&nbsp;");
                                    $delurl="confirm.php?url={$url}&rturl={$rturl}&message={$message}";
                                    if($count_rp){
                                       $datar=mysqli_fetch_assoc($resultr); 
                                    }else{
                                        $datar['time']=$datat['time'];
                                    }
                                    
                                    echo '<div class="group clear-float"><div class="smallPic fl"> ';
                                    if(empty($datam['photo'])){
                                        echo "<img width='50' height='50' src='/Project_bbs/img/三儿.jpg'></div>";
                                    }else{
                                        echo "<img width='50' height='50' src='{$datam['photo']}'></div>";
                                    }
$html=<<<A
                                    <div class="text_mark fl">
                                        <div class="title_wrap">
                                        <div class="fl" style="width:65%;"><a href="childList.php?id={$datat['cmid']}">[{$datac['moduleName']}]</a>&nbsp;&nbsp;<a class="bold" href="show.php?id={$datat['id']}">{$datat['title']}</a></div>
                                        <div class="fr" > <a href="mb_update.php?id={$datat['id']}" >[编辑]</a>  <a href="$delurl">[删除]</a></div>
                                        </div>
                                        <div class="remarks">楼主：<span>{$datam['name']}&nbsp;&nbsp;{$datat['time']}</span>&nbsp;&nbsp;最后回复：<span>{$datar['time']}</span></div>
                                    </div>
                                    <div class="count fr">
                                        <div class="part fr">回复<br/><span>{$count_rp}</span></div>
                                        <div class="part fr">浏览<br/><span>{$datat['times']}</span></div>           
                                    </div>
                                    </div>
A;
                                    echo $html;                            
                                }
                            }
                            ?>                
                            </div>



                            <div class="page_index">
                                    <div class="pages fr">
                                    <?php echo $datas['html'] ?>
                                    </div>
                            </div>
                    </div>
                    </div>
                </div>



                <div class="lfright fr">
                    <div class="content">
                        <?Php
                        if(empty($datam['photo'])){
                            echo " <img width='150' height='150' src='/Project_bbs/img/三儿.jpg'></div>";
                        }else{
                            echo " <img width='150' height='150' src='{$datam['photo']}'></div>";
                        }
                        echo "<span style='font-size: 20px;margin:3px 100px;'>{$datam['name']}</span>";
                        ?>
                        
                    </div>    
                </div>
            </div>
        </div>





       
            
        



 <?php
include_once 'inc/footer.inc.php';
?>